#ifndef PIVOTCOMPONENT_H
#define PIVOTCOMPONENT_H
#include "StompedReality/Core.h"
#include "StompedReality/Core/Component.h" // Base class: stomped_reality::entity_system::Component
#include "StompedReality/Math/Vector2.h"

StaticRegDummy( PivotComponent )

namespace StompedReality
{
namespace components
{

/*!
 * \author	Stefan Kazalski
 *
 * \brief	Pivot component type helper
 */
struct PivotComponentReg
{
  static int registeType( );
};

/*!
 * \author	Stefan Kazalski
 *
 * \brief	Pivot component.
 *
 *    Stores and sends translation and rotations of another component to the renderer<br>
 *    Send order:
 *     - push joint translation + rotation
 *     - pop
 */
class DLL_EXPORT PivotComponent : public StompedReality::Core::Component
{
  friend struct PivotComponentReg;

 protected:

  StompedReality::Math::Vector2 m_Translation;
  float m_Rotation;

 public:

  PivotComponent( );
  ~PivotComponent( );

 public:

  //! \brief	Draw function.
  //!   Sends the render information to the renderer.
  void Draw( );

  //! \brief	Exectuted after creation
  void OnCreation( );

  //! \brief	Exectuted before destruction
  void OnDestruction( );

  //! \brief	Exectuted afte values read by TypeSystem.
  //!			Initialzies the component.
  //! \param	constructionHelper The contruction helper.
  void InitializeComponent( StompedReality::Core::ComponentConstuctionHelper* constructionHelper );

  //! \brief	Processes a message.
  //! \param	msg The message.
  bool ProcessMessage ( StompedReality::Core::Message* msg );

  //! \brief	Update.
  void Update ( );
};

}
}
#endif // PIVOTCOMPONENT_H
